---
layout : doc
title : Event Aggregator in Phoenix
permalink: docs\EventAggregator.html
---

Phoenix uses the event aggregator from the [EventAggregator.Net](https://github.com/staxmanade/EventAggregator.Net) project on github, to provide integrated support, it is bundled in Phoenix, rather than just suggesting you install that package. 

### Usage from ViewModels

    public class MyViewModel : ViewModelBase, IListener<SomeEvent>
    {
        protected override void OnActivated()
        {
            base.OnActivated();
            EventAggregator.AddListener(this);
        }

        protected override void OnDeactivated()
        {
            base.OnDeactivated();
            EventAggregator.RemoveListener(this);
        }
    
        public void Handle(SomeEvent message)
        {
        
        }
    }

Currently there is no autoregistration, it will likely be added later.